package zhihui.mobile.manager;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import zhihui.mobile.config.Config;
import zhihui.mobile.interfaces.net.IHttpCallBackListener;
import zhihui.mobile.manager.user.UserManager;
import zhihui.mobile.net.HttpUtils;

/**
 * Created by 张公铭 on 2017/9/19 0019.
 */

public class MessageManager implements IManager
{
    private static MessageManager manager;

    private synchronized static void createdIns()
    {
        if (manager == null)
        {
            manager = new MessageManager();
        }
    }

    public static MessageManager getInstance()
    {
        if (manager == null)
        {
            createdIns();
        }
        return manager;
    }

    public void getMessageList(IHttpCallBackListener listener, int count)
    {
        Map<String, String> params = new HashMap<>();
        params.put("service", "org.zhmm.app.api.common.Push");
        params.put("method", "find");

        List<Object> list = new ArrayList<>();
        list.add(count);
        list.add(UserManager.getInstance().getCurUser().getId());

        HttpUtils.postAes(Config.URL, params, list, listener);
    }


    @Override
    public void clear()
    {

    }
}
